package cate.game.res.lottery;

import cate.game.activity.lottery.data.LotteryLog;
import cate.game.activity.lottery.data.LotteryLogDetail;
import cate.game.db.mongo.kv.KvMongo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteField;


public class LotterySPO extends KvMongo {
    @NoteField(value = "天机阁抽奖日志")
    public LotteryLog log;

    @Override
    public String getKeyPrefix() {
        return KvMongo.KEY_LOTTERY;
    }

    @Override
    public void initialize() {
        if (log == null) {
            log = new LotteryLog();
        }
        log.initialize();
    }

    @JsonIgnore
    public synchronized void addLog(LotteryLogDetail logDetail, int maxNum) {
        log.addLog(logDetail, maxNum);
    }

}
